home *** CD-ROM | disk | FTP | other *** search
- Generating C++ for Microsoft Visual C++
-
- 1. Microsoft Visual C++ 1.5 with QuickWin - Getting Started Visual C++ Script
-
- Class Diagram: vc15car.omt
- Script Files: vc15head.sct and vc15func.sct - also vc15hd1.sct and vc15fu1.sct with vc15mai1.cpp
- Main File: vc15main.cpp
-
- The easiest way to use With Class and Visual C++ is to create a QuickWin project. This will permit the use of
- the C++ iostream objects, e.g. cin and cout. The steps to generate Microsoft Visual C++ 1.5 code with
- QuickWin and to compile the generated files are as follows:
-
- >> Launch With Class from Windows
- >> Open cppcar.omt
- >> Double click on the Tire and Passenger classes to add the following in the Library Base Class box
- : public CObject. These are on the 1 : Many side. The objects are elements of CObList and CPtrList
- Collection classes
- >> Select "Generate - Generate Class Code"
- >> Select h as the file extension
- >> Select vc15head.sct to generate the header files (.h)
- >> Select "Generate - Generate Class Code"
- >> Select cpp as the file extension
- >> Select vc15func.sct to generate the source code files (.cpp)
- >> Select "File - Edit File" to examine the generated files, e.g. car.h
- >> Run Visual C++ environment
- >> Create QuickWin Car Project, e.g. carproj.mak and select "Use Microsoft Foundation Classes"
- >> Add the .cpp files to the project
- >> Compile all .cpp files
- >> Compile vc15main.cpp
- >> Execute the project
-
- Notes for Visual C++ 1.5. To use iostream.h then create a VC15 QuickWin project. Create a VC15 QuickWin
- project with vc15main.cpp. Add the following files to the project: vehicle.cpp, car.cpp, cellular.cpp,
- passenge.cpp, tire.cpp, motor.cpp, and vc15main.cpp.
-
- Select "Options Project Linker
- Miscellaneous" and enter /NOE. Select "Options Project
- Linker Windows-Library" and select COMMDLG and SHELL.
-
- Copy stdafx.h and stdafx.cpp into your directory.
-
- This script uses CPtrList ASSOCIATION_MANY_NAME and CObList AGGREGATION_MANY_NAME for 1 to
- Many Relationships. For your highest base class of any class whose objects are elements of the CObList or
- CPtrList collection classes, enter : public Cobject in the Class Specification Library Base Class.
-
- For Visual C++ 2.0 1 : Many relationships substitute a template collection class for the CObList and CPtrList
- such CList<Passenger>.
-
- 2. Microsoft Visual C++ 1.5 for a Windows Application - Getting Started Visual C++ Script
-
- Class Diagram: vc15car.omt
- Script Files: vc15hdex.sct and vc15fuex.sct
- Main File: N/A
-
- The steps to generate Microsoft Visual C++ 1.5 code for a Windows EXE and to compile the generated files are
- as follows:
-
- >> Launch With Class from Windows
- >> Open vc15car.omt
- >> Double click on the Tire and Passenger classes to add the following in the Library Base Class box
- : public CObject. These are on the 1 : Many side. The objects are elements of CObList and CPtrList
- Collection classes.
- >> Select "Generate - Generate Class Code"
- >> Select h as the file extension
- >> Select vc15hdex.sct to generate the header files (.h)
- >> Select "Generate - Generate Class Code"
- >> Select cpp as the file extension
- >> Select vc15fuex.sct to generate the source code files (.cpp)
- >> Select "File - Edit File" to examine the generated files, e.g. car.h
- >> Run Visual C++ environment
- >> Select "App Expert"
- >> Create Windows Application Car Project, e.g. XXX.mak
- >> Add the .cpp files to the project
- >> Select "File - Open" XXXdoc.h file to add #include "car.h" as an include file and add Car car1; as a data
- member
- >> Compile all .cpp files
- >> Update the XXXdoc with functions to invoke the car functions
- >> Execute the project
-
- Note: This script uses CPtrList ASSOCIATION_MANY_NAME and CObList AGGREGATION_MANY_NAME
- for 1 to Many Relationships. For your highest base class of any class whose objects are elements of the
- CObList or CPtrList collection classes, enter : public CObject in the Class Specification Library Base Class.
-
- For Visual C++ 2.0 1 to Many relationships substitute a template collection class for the CObList such
- CList<Passenger>.
-
- Please send comments to Richard Felsinger 71162,755@compuserve.com telephone 803-881-3648.
-
-